package com.wyk.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author WangYuKai
 * @Date 2022/6/23
 * @apiNote
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PRYMENT" ,fallback = PaymentFallBackService.class)//指定兜底的执行类
public interface FeignHystrixService {

    @GetMapping("/payment/hystrix/{id}")
    public String paymentOk(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    public String paymentError(@PathVariable("id") Integer id);

}
